<script setup lang="ts" >
import MemMarkEditor from '../components/MemMarkEditor.vue';
import { setWinSizeKey, setSearchTagKey } from '../model/type.ts'
import { createMemApi } from '../api/index'
import { inject, onMounted, ref } from 'vue';
import { create } from 'naive-ui';
import { useRouter } from 'vue-router';
const router = useRouter()
const handerWinSzie = inject(setWinSizeKey)
const setSearchTag = inject(setSearchTagKey)
const content = ref("")

const save = async () => {
    const dict = {}
    //const res = await createMemApi(dict)
    router.push('/')

}
onMounted(() => {
    setSearchTag!('markdown编辑')
    handerWinSzie!()
})
const afterIt = () => {

    handerWinSzie!()
}
</script>
<template>
    <MemMarkEditor style="" v-model:content="content" @afterInit="afterIt">
        <template #underBtn>
            <n-space>
                <n-input style="width: 400px;" placeholder="输入标题"></n-input>
                <n-button type="primary" size="medium">保存</n-button>
            </n-space>
        </template>
    </MemMarkEditor>
</template>
<style scoped></style>